﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Niunan.VideoSys.Web.Controllers
{
    public class VideoController : Controller
    {
        // GET: Video
        public ActionResult Show(int id)
        {
            DAL.VideoDAL vdal = new DAL.VideoDAL();
            Model.Video v = vdal.GetModel(id);
            if (v != null)
            {
                ViewBag.title = v.title;
                ViewBag.body = v.body;

                v.visitnum++;
                vdal.Update(v);
            }
            List<Model.Videomx> mxlist = new DAL.VideomxDAL().GetListArray($"videoid={id}");
            return View(mxlist);
        }
    }
}